package br.com.infocruz.seam.crm.ejb.session;

import br.com.infocruz.seam.crm.ejb.model.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("auditTrailList")
public class AuditTrailList extends EntityQuery<AuditTrail> {

	private static final String EJBQL = "select auditTrail from AuditTrail auditTrail";

	private static final String[] RESTRICTIONS = { "lower(auditTrail.className) like lower(concat(#{auditTrailList.auditTrail.className},'%'))",
			"lower(auditTrail.methodName) like lower(concat(#{auditTrailList.auditTrail.methodName},'%'))", };

	private AuditTrail auditTrail = new AuditTrail();

	public AuditTrailList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public AuditTrail getAuditTrail() {
		return auditTrail;
	}
}
